<template>
    <div class="video-details-view" v-if="dataArr?.length">
        <van-swipe class="my-swipe" :loop="true" :show-indicators="false" :duration="50" vertical>
            <van-swipe-item v-for="item in dataArr" :key="item.postData.postView.id">
                <video-item :src="item.postData.postView.videoPostView.videoInfo.flashurl" :data="item"></video-item>
            </van-swipe-item>
        </van-swipe>
    </div>
</template>

<script setup lang="ts">
import { Api } from "@/utils/apis"
import { onMounted, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import VideoItem from '@/components/HomeComponents/VideoPlayer/VideoItem.vue'
const route = useRoute()
const router = useRouter()

const list = ref<any>([]);
const loading = ref(false);
const finished = ref(false);

let permalink = ref<string>()
let dataArr = ref<Array<any>>()

permalink.value = route.query.permalink as unknown as string



// 获取数据
const getVideoDetails = async () => {
    let data = await Api.getVideoDetails({
        permalink: permalink.value
    })
    // console.log(data);
    dataArr.value = data.data.list
}


onMounted(() => {
    getVideoDetails()
})
</script>

<style scoped lang="scss">
.video-details-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    min-height: 100vh;
    overflow: auto;
    z-index: 100;
    background-color: rgb(255, 255, 255);

    .my-swipe .van-swipe-item {
        color: #fff;
        font-size: 0px;
        // line-height: 150px;
        text-align: center;
        background-color: #ffffff;
    }


}
</style>